package com.lwx.smipleemps.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/logout.do")
public class LogoutServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        销毁session
        request.getSession().invalidate();//
//       跳回登录页面
        request.setAttribute("msg","已经退出登录");
        request.getRequestDispatcher("/login.jsp").forward(request,response);
    }
}
